<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateAgentRewardRuleSettingsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('agent_reward_rule_settings', function (Blueprint $table) {
            $table->id();
            $table->bigInteger('operator_id')->default(0)->comment('最后一次的操作人 ID');
            $table->tinyInteger('type')->comment('类型; 1:充值奖励 2:每日下单奖励 3:每月下单奖励');
            $table->unsignedBigInteger('threshold_amount')->default(0)->comment('门槛金额 (单位 分)');
            $table->unsignedBigInteger('reward')->default(0)->comment('奖励 (单位 分)');

            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('agent_reward_rule_settings');
    }
}
